#include<bits/stdc++.h>
using namespace std;
int n;
int a[200011],b[200011];
int ma[200011],mb[200011];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("min.in","r",stdin);
	freopen("min.out","w",stdout);
	cin >> n;
	for(int i = 1;i <= n;i++)
		cin >> a[i];
	for(int i = 1;i <= n;i++)
		cin >> b[i];
	if(n <= 1000)
	{
		for(int i = 1;i <= n;i++)
			ma[i] = INT_MAX,mb[i] = INT_MAX;
		for(int k = 0;k < n;k++)
		{
			int ans = INT_MAX;
			for(int i = 1;i + k <= n;i++)
				ma[i] = min(ma[i],a[i + k]),mb[i] = min(mb[i],b[i + k]),ans = min(ans,abs(ma[i] - mb[i]));
			cout << ans << "\n";
		}
	}else{
		int ans = INT_MAX;
		for(int i = 1;i <= n;i++)
			ans = min(ans,a[i] - 1);
		while(n--)
			cout << ans << "\n";
	}
	return 0;
}
